#region
using System;
using System.IO;

#endregion

namespace ComicsDownloader.Engine
{
    public static class Utility
    {
        private static readonly char[] _invalids = Path.GetInvalidFileNameChars();

        public static string ToValidFileName(string fileName)
        {
            return string.Join("_", fileName.Split(_invalids, StringSplitOptions.RemoveEmptyEntries)).TrimEnd('.');
        }
    }
}